class BeerSong {

    String verse(final int inputNumber) {
        if (inputNumber <= 0) {
            return "No more bottles of beer on the wall, no more bottles of beer.\n" +
                    "Go to the store and buy some more, 99 bottles of beer on the wall.\n\n";
        }

        return String.format("%s of beer on the wall, %s of beer.\n" +
                        "Take %s down and pass it around, %s of beer on the wall.\n\n",
                inputNumber == 1 ? inputNumber + " bottle" : inputNumber + " bottles",
                inputNumber == 1 ? inputNumber + " bottle" : inputNumber + " bottles",
                inputNumber == 1 ? "it" : "one",
                inputNumber - 1 == 1 ?
                        inputNumber - 1 + " bottle" :
                        inputNumber - 1 == 0 ?
                                "no more bottles" : inputNumber -1 + " bottles");
    }

    String sing(final int startVerse, final int endVerse) {
        StringBuilder result = new StringBuilder();

        for (int i = startVerse; i >= endVerse; i--) {
            result.append(this.verse(i));
        }

        return result.toString();
    }

    String singSong() {
        return this.sing(99, 0);
    }
}